home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / sdoor100.zip / SDOOR.BI < prev    next >
Text File  |  1992-03-25  |  15KB  |  445 lines

  1. '                             ---FUNCTIONS---
  2.  
  3. DECLARE FUNCTION AColor$ (Fore%, Back%)
  4. '       Makes an optimized ansi color string
  5. '       Fore% = Foreground color to use
  6. '       Back% = Background color to use
  7. '
  8. '       EXAMPLE:
  9. '               Send AColor$(7,1)+"White on blue"
  10.  
  11. DECLARE FUNCTION CtrlCK% ()
  12. '       Checks if Control C/K have been checked.  Also enables Control C/K
  13. '       checking.  Returns -1 if true, 0 if not true.
  14. '
  15. '       EXAMPLE:
  16. '               IF CtrlCK% THEN
  17. '                       FlushOut
  18. '                       SendCr "Aborted."
  19. '               END IF
  20.  
  21. DECLARE FUNCTION Exist% (FileName$)
  22. '       Returns a non-zero value if the file exists.
  23. '
  24. '       EXAMPLE:
  25. '               IF Exist%("TEST.TTT") THEN Send "File FOUND"
  26.  
  27. DECLARE FUNCTION GetAnsi% ()
  28. '       Gets the current ansi setting.  Returns -1 if true, 0 if not true.
  29. '
  30. '       EXAMPLE:
  31. '               AnsiMode%=GetAnsi%
  32. '               IF AnsiMode% THEN
  33. '                       SendCr "Ansi is active"
  34. '               ELSE
  35. '                       SendCr "Ansi is not active"
  36. '               END IF
  37.  
  38. DECLARE FUNCTION GetBaudRate& ()
  39. '       Gets the current baud rate of the user (Door Info).  0 if local.
  40. '
  41. '       EXAMPLE:
  42. '               Send "You are running at" + STR$(GetBaudRate&)
  43.  
  44. DECLARE FUNCTION GetBBSName$ ()
  45. '       Gets the BBS name from the door file.
  46. '
  47. '       EXAMPLE:
  48. '               SendCr "Your sysop is: " + GetSysopName$
  49.  
  50. DECLARE FUNCTION GetCarrier% ()
  51. '       Gets the current carrier state.  Non-zero if there is a carrier.
  52. '       The user's carrier is automatically managed.  This is not really
  53. '       needed.
  54. '
  55. '       EXAMPLE:
  56. '               IF GetCarrier% THEN Send "YOU ARE STILL CONNECTED"
  57.  
  58. DECLARE FUNCTION GetPort% ()
  59. '       Gets the current serial port setting.  -1 if local
  60. '
  61. '       EXAMPLE:
  62. '               Send "You are on com port" + STR$(GetPort%)
  63.  
  64. DECLARE FUNCTION GetSecLevel& ()
  65. '       Gets the user's security level.
  66. '
  67. '       EXAMPLE:
  68. '               Send "Your security Level is" + STR$(GetSecLevel&)
  69.  
  70. DECLARE FUNCTION GetSnoopState% ()
  71. '       Gets the status of the snoop setting on the SysOp's side.
  72. '       Returns -1 if true, 0 if not.
  73. '
  74. '       EXAMPLE:
  75. '               IF GetSnoopState% THEN
  76. '                       Send "Snoop is ON"
  77. '               ELSE
  78. '                       Send "Snoop is OFF"
  79. '               ENDIF
  80.  
  81. DECLARE FUNCTION GetSysopName$ ()
  82. '       Gets the sysop's name,  in all uppercase.
  83. '
  84. '       EXAMPLE:
  85. '               Send "Your sysop is: " + GetSysopname$
  86.  
  87. DECLARE FUNCTION GetTimeLeft% ()
  88. '       Gets the amount of time the user has left in minutes.
  89. '
  90. '       EXAMPLE:
  91. '               Send "You have" + STR$(GetTimeLeft%)+" minutes left."
  92.  
  93. DECLARE FUNCTION GetUserLocation$ ()
  94. '       Gets the user's location (DOOR INFO) in all uppercase
  95. '
  96. '       EXAMPLE:
  97. '               Send "Your location is: " + GetUserLocation$
  98.  
  99. DECLARE FUNCTION GetUserName$ ()
  100. '       Gets the user's name (DOOR INFO) in all uppercase
  101. '
  102. '       EXAMPLE:
  103. '               Send "Your name is: " + GetUserName$
  104.  
  105. '                          ---END OF FUNCTIONS---
  106. '                            ---SUBROUTINES---
  107.  
  108. DECLARE SUB Center (St$)
  109. '       Centers the specified text and stays on the same line.
  110. '
  111. '       EXAMPLE:
  112. '               Center "Testing the centering routine"
  113.  
  114. DECLARE SUB CenterCr (St$)
  115. '       Centers the specified text and creates a new line.
  116. '
  117. '       EXAMPLE:
  118. '               CenterCr "Testing the centering routine"
  119.  
  120. DECLARE SUB Chat ()
  121. '       Starts a chatmode with the user.  Restores the colors to normal
  122. '       afterwards.
  123. '
  124. '       EXAMPLE:
  125. '               SendCr "Forced CHAT:"
  126. '               Chat
  127.  
  128.  
  129. DECLARE SUB ClearScreen ()
  130. '       Clears the screen
  131. '
  132. '       EXAMPLE:
  133. '               ClearScreen
  134.  
  135. DECLARE SUB ComParms (BaudRate&, Flag$)
  136. '       Sets the communications parameters.  These are already set upon
  137. '       initialization.  There should be no need to play with them.
  138. '
  139. '       BaudRate& can be:  300, 600, 1200, 2400, 4800, 9600, 19200, 38400
  140. '       Flag$ takes the form of: "8N1" where the 8 can be replaced by:
  141. '                                       5, 6, 7, 8   (Data bits)
  142. '                                and the N can be replaced by:
  143. '                                       N, O, E      (Parity)
  144. '                                and the 1 can be replaced by:
  145. '                                       1, 2         (Stop bits)
  146. '
  147. '       EXAMPLE:
  148. '               ComParms 2400, "8N1"
  149.  
  150. DECLARE SUB CtrlCKOn ()
  151. '       Turns on Control-C/K checking.
  152. '
  153. '       EXAMPLE:
  154. '               CtrlCKOn
  155.  
  156. DECLARE SUB CtrlCKOff ()
  157. '       Turns off Control-C/K checking.
  158. '
  159. '       EXAMPLE:
  160. '               CtrlCKOff
  161.  
  162. DECLARE SUB DeInitialize ()
  163. '       Turns off the status bar and removes it from the screen.  Disables
  164. '       the door driver and turns off the door driver's internal error
  165. '       checking.  Also causes Send, SendCr, and all other routines to
  166. '       malfunction.  DO NOT DO ANY OTHER DOORDRIVER CALLS AFTER
  167. '       DEINITIALIZING!  DOES NOT TERMINATE THE PROGRAM.
  168. '
  169. '       EXAMPLE:
  170. '               DeInitialize
  171. '               Print "Cleaning up after door"
  172. '               END
  173.  
  174. DECLARE SUB DetectAnsi (Ansi%)
  175. '       Detects Ansi (Remote user)
  176. '       Returns -1 or 0 into Ansi% (or any other variable of your choice)
  177. '
  178. '       EXAMPLE:
  179. '               DetectAnsi Ansi%                    
  180. '               SetAnsi Ansi%
  181.  
  182. DECLARE SUB FlushIn ()
  183. '       Flushes the inbound modem buffer.  Wipes all user keystrokes.
  184. '
  185. '       EXAMPLE:
  186. '               FlushIn
  187. '               Send "What now sire? "
  188. '               GetChar ToDoThis$
  189. '               SendCr ToDoThis$
  190.  
  191. DECLARE SUB FlushOut ()
  192. '       Flushes the outbound modem buffer.  Usefull for stopping screens
  193. '       when Control-C/K have been pressed.
  194. '
  195. '       EXAMPLE:
  196. '               SendCr "Press Control-C/K to stop this mess"
  197. '               CtrlCKOn
  198. '               DO
  199. '                       SendCr "Testing 1234567890..."
  200. '                       I$ = Inkey$
  201. '               LOOP UNTIL I$ = CHR$(3) OR I$ = CHR$(11) OR CtrlCK%
  202. '               SendCr "Aborted."
  203.  
  204. DECLARE SUB GetChar (Ch$)
  205. '       Gets a character from the modem into Ch$.  (Ch$ can be any
  206. '       variable)
  207. '
  208. '       EXAMPLE:
  209. '               SendCr "Yo there dude!  Press any key please!"
  210. '               GetChar Test$
  211. '               SendCr "Thanks!"
  212.  
  213. DECLARE SUB GetColor (Fore%, Back%)
  214. '       Gets the current foreground and background colors.
  215. '   
  216. '       EXAMPLE:
  217. '               GetColor ForeGround%, BackGround%
  218. '               SendCr "The foreground color is: " + STR$(ForeGround%)
  219. '               SendCr "The background color is: " + STR$(BackGround%)
  220.  
  221. DECLARE SUB GetCurPos (X%, Y%)
  222. '       Gets the cursor position.
  223. '       X% = The Current Row
  224. '       Y% = The Current Column
  225. '
  226. '       EXAMPLE:
  227. '               GetCurPos X%, Y%
  228. '               SendCr "The row is: " + STR$(X%)
  229. '               SendCr "The column is: " + STR$(Y%)
  230.         
  231. DECLARE SUB GetString (St$, Max%, Mode%)
  232. '       Gets a string from the modem/console.
  233. '       St$ = The returned string.
  234. '       Max% = The max width/value.
  235. '       Mode% = Input mode:
  236. '               0  :-   Normal Input, exactly as entered.
  237. '                       Max% = Maximum length in characters.
  238. '               1  :-   UserName Input, Every first character of a word is
  239. '                       converted to uppercase.  Uppercase characters after
  240. '                       the first letter of each word are accepted.
  241. '                       Max% = Maximum length in characters.
  242. '               2  :-   Numeric input.  Allows from 0 to the number specified.
  243. '                       Allows blank strings for 0.  Returned value is a
  244. '                       string.
  245. '                       Max% = Maximum value (Integer value; 0 - 32767)
  246. '               3  :-   Password input.  Outputs dots (.) instead of entered
  247. '                       characters.  Case